<html>
<head>
    <meta charset="utf-8"/>
    <title>尬聊</title>
    <link rel="manifest" href="manifest.json">
    <link rel="shortcut icon " type="images/x-icon" href="./favicon.ico">
    <script src="https://cdn.bootcss.com/vue/2.4.4/vue.min.js"></script>
    <script src="https://cdn.bootcss.com/element-ui/1.4.6/index.js"></script>
    <script src="https://cdn.bootcss.com/paho-mqtt/1.0.2/mqttws31.min.js"></script>
    <link href="https://cdn.bootcss.com/element-ui/1.4.6/theme-default/index.css" rel="stylesheet">
</head>
<body>


<style>
    [v-cloak] {display: none}
    ::-webkit-scrollbar-track-piece {
    background-color:#f8f8f8;
    }
    ::-webkit-scrollbar {
    width:9px;
        height:9px;
    }
    ::-webkit-scrollbar-thumb {
    background-color:#dddddd;
        background-clip:padding-box;
        min-height:28px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background-color:#bbb;
    }
</style>
<div v-cloak>
    <el-card style="height:93%" :style="{'height':bh}">
        <div style="width:93%;position:absolute;bottom: 30px">
            <el-input placeholder="输入内容 Enter键发送 输入  /name 名字 更换名字;/help显示帮助;/任何搜索条件 发送斗图表情" style="width:90%" v-model="tosend" @keyup.enter.native="send"></el-input>
        </div>
        <div id="chat" style="margin-bottom: 100px; overflow: auto;padding:3px" :style="{'height':ch}">
            <div v-for="m in messages" style="margin-top: 1px">
                <div v-if="m.type=='message'">
                    <div style="height:20px;width:80%">
                        <span style="font-size: 14px">{{m.name}}</span> <span style="font-size: 12px">{{m.time}}</span>
                    </div>
                    <el-tag type="primary" style="margin:2px">{{m.text}}</el-tag>
                </div>
                <div v-if="m.type=='alert'">
                    <el-alert
                            :title="m.alert"
                            :description="m.description"
                           >
                    </el-alert>
                </div>
                <div v-if="m.type=='huaji'">
                    <div style="height:20px;width:80%">
                        <span style="font-size: 14px">{{m.name}}</span> <span style="font-size: 12px">{{m.time}}</span>
                    </div>
                    <template i-if="m.url.indexOf('https')==0">
                        <img sytle="width:144px;height:144px" @load="imageLoaded" :src="m.url" >
                    </template>
                    <template v-else>
                        <img sytle="width:144px;height:144px" @load="imageLoaded" :src=" 'images/huaji/' + m.url" >
                    </template>
                </div>
            </div>
        </div>
    </el-card>
</div>
<script src="source.js">
</script>
</body>
</html>
